package com.jeecg.p3.dzdp.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import org.jeecgframework.p3.core.utils.common.PageList;
import org.jeecgframework.p3.core.utils.common.PageQuery;
import org.jeecgframework.p3.core.utils.common.Pagenation;
import com.jeecg.p3.dzdp.service.WxActDzdpOptService;
import com.jeecg.p3.dzdp.entity.WxActDzdpOpt;
import com.jeecg.p3.dzdp.dao.WxActDzdpOptDao;

@Service("wxActDzdpOptService")
public class WxActDzdpOptServiceImpl implements WxActDzdpOptService {
	@Resource
	private WxActDzdpOptDao wxActDzdpOptDao;

	@Override
	public void doAdd(WxActDzdpOpt wxActDzdpOpt) {
		wxActDzdpOptDao.add(wxActDzdpOpt);
	}

	@Override
	public void doEdit(WxActDzdpOpt wxActDzdpOpt) {
		wxActDzdpOptDao.update(wxActDzdpOpt);
	}

	@Override
	public void doDelete(String id) {
		wxActDzdpOptDao.delete(id);
	}

	@Override
	public WxActDzdpOpt queryById(String id) {
		WxActDzdpOpt wxActDzdpOpt  = wxActDzdpOptDao.get(id);
		return wxActDzdpOpt;
	}

	@Override
	public PageList<WxActDzdpOpt> queryPageList(
		PageQuery<WxActDzdpOpt> pageQuery) {
		PageList<WxActDzdpOpt> result = new PageList<WxActDzdpOpt>();
		Integer itemCount = wxActDzdpOptDao.count(pageQuery);
		List<WxActDzdpOpt> list = wxActDzdpOptDao.queryPageList(pageQuery,itemCount);
		Pagenation pagenation = new Pagenation(pageQuery.getPageNo(), itemCount, pageQuery.getPageSize());
		result.setPagenation(pagenation);
		result.setValues(list);
		return result;
	}
	
	public List<WxActDzdpOpt> queryOpts(String jwid){
		return  wxActDzdpOptDao.queryOpts(jwid);
	}
}
